<%@ page import="java.net.InetAddress" %>
<%@ page import="java.net.NetworkInterface" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.List" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <%--<%response.sendRedirect("page/view/BI-index.html");%>--%>

<body>
部署成功
<%!
    private String getIp() {
        List<String> iplist = new ArrayList<String>();
        try {
            String a = "";

            Enumeration netInterfaces = NetworkInterface.getNetworkInterfaces();
            InetAddress ip = null;
            while (netInterfaces.hasMoreElements()) {
                NetworkInterface ni = (NetworkInterface) netInterfaces.nextElement();
                Enumeration<InetAddress> obj = ni.getInetAddresses();
                while (obj.hasMoreElements()) {

                    InetAddress ia = obj.nextElement();
                    iplist.add(ia.getHostAddress());
                }
                ip = (InetAddress) ni.getInetAddresses().nextElement();

                if (!ip.isSiteLocalAddress() && !ip.isLoopbackAddress()
                        && ip.getHostAddress().indexOf(":") == -1) {
                    a = ip.getHostAddress();
                    break;
                } else {
                    ip = null;
                }
            }
        } catch (Exception ex) {

        }

        String aaa = "";
        for (String a : iplist) {
            aaa += "******" + a + "***";
        }
        return aaa;
    }
%>
<%=getIp()%>
</body>
</html>
